package br.eti.robsonfranca.clf4j.impl.win;

import br.eti.robsonfranca.clf4j.impl.Color;

public class WinColor {
	public static short toWinColor(Color c) {
		short ret = 0;
		switch (c.getCode()) {
			case BLUE: ret = 1; break;
			case GREEN: ret = 2; break;
			case RED: ret = 4; break;
			case CYAN: ret = 1 + 2; break;
			case MAGENTA: ret = 1 + 4; break;
			case YELLOW: ret = 2 + 4; break;
			case WHITE: ret = 1 + 2 + 4; break;
			default: ret = 0; 
		}
		ret += (c.isBright() ? 8 : 0);
		return ret;
	}
}
